package jjn.effective_java.chapter6.item36;

import java.util.EnumSet;
import java.util.Set;

/**
 * @author Jiang Jining
 * @since 2023-04-27 23:21
 */
public class Text {
    public enum Style {
        BOLD, ITALIC, UNDERLINE, STRIKETHROUGH
    }
    
    public void applyStyle(Set<Style> styles) {
        for (Style style : styles) {
            if (Style.BOLD.equals(style)) {
                System.out.println("style = " + style);
            }
        }
    }
    
    public static void main(String[] args) {
        new Text().applyStyle(EnumSet.of(Style.BOLD, Style.ITALIC));
    }
}
